package trainfengxing.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import trainfengxing.pojo.Result;
import trainfengxing.pojo.news;

import java.util.List;

@Slf4j
@RestController
public class newsController {
    @Autowired
    private trainfengxing.service.newsService newsService;

    @GetMapping("/news")
    public Result newsselect() {
        log.info("查询新闻");
        List<news> newss = newsService.newsselect();
        return Result.success(newss);
    }
}
